﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using ZIP;
using System.IO;

namespace WebService_FileOperation
{
    /// <summary>
    /// FileZip 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class FileZip : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        /// <summary>
        /// 对服务器上文件进行压缩处理
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public string Zip(string passKey)
        {
            string path = string.Empty;
            string desPath = Path.Combine(Server.MapPath("upload"), "item");
          //  ZIPHelper.ZipFile(@"d:\\zip123\123", @"D:\bb.zip");
            return desPath;
        }

    }
}
